package java3_14;

import java.util.Scanner;

public class Cal_application {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Calculator cal = new Calculator();
        cal.brand = "卡西欧";
        cal.color = "黑色";
        cal.price = "19.9￥";

        System.out.println("计算机的基本信息如下:" + "\n" + cal.brand + "\n" + cal.color + "\n" + cal.price);
        while (true) {
            System.out.println("请输入要进行的操作: 1.加法  2.减法  3.乘法  4.除法  5.立方  6.退出");
            int x = scanner.nextInt();
            switch (x) {
                case 1:{
                System.out.println("请输入要相加的数:");
                int a = scanner.nextInt();
                int b = scanner.nextInt();
                System.out.println("两数相加的结果为:" + cal.add(a, b));
                break;
                }
                case 5: {
                    System.out.println("请输入要计算立方的数:");
                    float c = scanner.nextFloat();
                    System.out.println("这个数的立方为:" + cal.cube(c));
                    break;
                }
                case 2:{
                System.out.println("请输入要相减的数：");
                int d = scanner.nextInt();
                int e = scanner.nextInt();
                System.out.println("这两个数相减的结果为:" + cal.sub(d, e));
                    break;
                }
                case 3:{
                    System.out.println("请输入要相乘的数：");
                    float f = scanner.nextFloat();
                    float g = scanner.nextFloat();
                    System.out.println("这两个数相乘的结果为:"+cal.mul(f,g));
                    break;
                }
                case 4:{
                    System.out.println("请输入要相除的数：");
                    float h = scanner.nextFloat();
                    float i = scanner.nextFloat();
                    System.out.println("这两个数相除的结果为："+cal.division(h,i));
                    break;
                }
                case 6:{
                    return;
                }
            }
        }
    }
}
